package com.common.holder;

public class UserHolder {
    public static final ThreadLocal<Long> USER_ID_HODLER = new ThreadLocal<>();
    //添加
    public static void setUserIdHodler(Object id){
        USER_ID_HODLER.set(Long.valueOf(id.toString()));
    }
    //删除
    public static void removeUserIdHolder(){
        USER_ID_HODLER.remove();
    }
    //获取
    public static Long getUserId(){
        return USER_ID_HODLER.get();
    }
}
